package pl.ydp.components.mathcell.mathrecognizer.engine.database.modelsets.math_basic.characters
{
	import pl.ydp.components.mathcell.mathrecognizer.characters.Character;
	import pl.ydp.components.mathcell.mathrecognizer.geometry.classification.PrimitiveType;
	import pl.ydp.components.mathcell.mathrecognizer.model.PrimitivesRelation;
	import pl.ydp.components.mathcell.mathrecognizer.model.RelationDescription;
	import pl.ydp.components.mathcell.mathrecognizer.model.RelationDescriptorType;
	import pl.ydp.components.mathcell.mathrecognizer.model.ShapeModel;
	import pl.ydp.components.mathcell.mathrecognizer.model.descriptors.LocationDescriptor;
	import pl.ydp.components.mathcell.mathrecognizer.model.descriptors.SizeDescriptor;
	import pl.ydp.components.mathcell.mathrecognizer.model.presets.PrimitivePresets;
	
	public class MB_ch_cma
	{
		
		public static const MODELS_COUNT:Number = 1;
		
		//---------------------------------------------------
		
		public static function getModels():Array{
			
			var commaShapeModels:Array = new Array();
			
			commaShapeModels.push(getModel0());	
			commaShapeModels.push(getModel1());	
			
			return commaShapeModels;
		}
		
		//---------------------------------------------------
		
		private static function getModel0():ShapeModel{
			var comma:ShapeModel;
			var name:String = "MB_,_CMA";
			var comma_prim:Array = new Array();
			var comma_ref:Array = new Array();
			var comma_rel:Array = new Array();
			
			comma_prim.push(PrimitiveType.LINE2 | PrimitiveType.LINE3);
			
			comma_ref.push(0,PrimitivePresets.ABS_LOWER_HALF, PrimitivePresets.ABS_UPPER_QUARTER);
			
			comma_rel.push(new RelationDescription(0,1,new PrimitivesRelation(RelationDescriptorType.SIZE, SizeDescriptor.LENGTH | SizeDescriptor.SHORTER | SizeDescriptor.THAN_HEIGHT, 10)));
			
			comma_rel.push(new RelationDescription(0,2,new PrimitivesRelation(RelationDescriptorType.LOCATION, LocationDescriptor.OUTSIDE_WHOLE, 10)));
			
			comma = new ShapeModel(Character.COMMA, comma_prim, comma_ref, comma_rel, new Array(), name, false, true);
			
			return comma;						
		}
		
		//---------------------------------------------------
		
		private static function getModel1():ShapeModel{
			var comma:ShapeModel;
			var name:String = "MB_,_REV";
			var comma_prim:Array = new Array();
			var comma_ref:Array = new Array();
			var comma_rel:Array = new Array();
			
			comma_prim.push(PrimitiveType.LINE1);
			
			comma_ref.push(0,PrimitivePresets.ABS_LOWER_HALF);
			
			comma_rel.push(new RelationDescription(0,1,new PrimitivesRelation(RelationDescriptorType.SIZE, SizeDescriptor.LENGTH | SizeDescriptor.SHORTER | SizeDescriptor.THAN_HEIGHT, 10)));
			
			comma_rel.push(new RelationDescription(0,1,new PrimitivesRelation(RelationDescriptorType.LOCATION, LocationDescriptor.INSIDE_WHOLE, 10)));
			
			comma = new ShapeModel(Character.COMMA, comma_prim, comma_ref, comma_rel, new Array(), name, false, true);
			
			return comma;						
		}


	}
}